/* 仪表板组件样式 */
.dashboard-header {
  text-align: center;
  margin-bottom: 30px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.stat-card {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  color: var(--primary-color);
  margin: 10px 0;
}

.stat-label {
  color: var(--dark-gray);
  font-size: 1.1em;
}

.recent-section {
  margin: 30px 0;
}

.recent-section h3 {
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

/* 搜索组件样式 */
.search-component {
  position: relative;
  max-width: 500px;
  margin: 20px auto;
  width: 100%;
}

.search-input-container {
  display: flex;
  align-items: center;
  background-color: var(--container-bg);
  border: 1px solid var(--border-color);
  border-radius: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
}

.search-input-container:focus-within {
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.search-input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background-color: transparent;
  color: var(--text-color);
  font-size: 15px;
  outline: none;
  border-radius: 25px 0 0 25px;
}

.search-button {
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0 25px 25px 0;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-button:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

.search-button:active {
  transform: scale(0.95);
}

.search-icon {
  margin-right: 5px;
}

.clear-button {
  position: absolute;
  right: 80px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark-gray);
  font-size: 18px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.clear-button:hover {
  background-color: var(--light-gray);
  color: var(--text-color);
}

/* 搜索组件深色主题样式 */
body.dark-theme .search-input-container {
  background-color: var(--container-bg);
  border-color: var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .search-input-container:focus-within {
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
  border-color: var(--primary-color);
}

body.dark-theme .search-input {
  background-color: transparent;
  color: var(--text-color);
}

body.dark-theme .search-button {
  background-color: var(--primary-color);
  color: white;
}

body.dark-theme .search-button:hover {
  background-color: var(--primary-dark);
}

body.dark-theme .clear-button {
  color: var(--dark-gray);
}

body.dark-theme .clear-button:hover {
  background-color: var(--light-gray-dark);
  color: var(--text-color);
}

/* 用户管理组件样式 */
.user-form {
  background-color: var(--light-gray);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.user-form h3 {
  margin-top: 0;
}

.user-list-container {
  margin-top: 20px;
}

.user-item {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s;
}

.user-item:hover {
  background-color: rgba(76, 175, 80, 0.05);
}

.user-details {
  flex: 1;
}

.user-actions {
  display: flex;
  gap: 10px;
}

/* 文章管理组件样式 */
.post-form {
  background-color: var(--light-gray);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.post-form h3 {
  margin-top: 0;
}

.post-list-container {
  margin-top: 20px;
}

.post-item {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s;
}

.post-item:hover {
  background-color: rgba(76, 175, 80, 0.05);
}

.post-title {
  margin: 0 0 10px 0;
  color: var(--primary-color);
}

.post-meta {
  color: var(--dark-gray);
  font-size: 0.9em;
  margin: 10px 0;
}

.post-excerpt {
  margin: 15px 0;
  color: #555;
  line-height: 1.6;
}

.post-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 分类管理组件样式 */
.category-form {
  background-color: var(--light-gray);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.category-form h3 {
  margin-top: 0;
}

.category-list-container {
  margin-top: 20px;
}

.category-item {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s;
}

.category-item:hover {
  background-color: rgba(76, 175, 80, 0.05);
}

.category-details h4 {
  margin: 0 0 5px 0;
}

.category-description {
  color: var(--dark-gray);
  font-size: 0.9em;
}

.category-actions {
  display: flex;
  gap: 10px;
}

/* 文章详情组件样式 */
.post-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.post-detail-modal {
  position: relative;
  width: 80%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.post-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.post-detail-title {
  margin: 0;
  color: var(--primary-color);
}

.post-detail-meta {
  padding: 15px 20px;
  background-color: var(--light-gray);
  color: var(--dark-gray);
  font-size: 0.9em;
}

.post-detail-content {
  padding: 20px;
  line-height: 1.8;
  color: #444;
}

.comment-section {
  padding: 0 20px 20px 20px;
}

.comment-form {
  background-color: var(--light-gray);
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.comment-form h3 {
  margin-top: 0;
}

.comment-list {
  margin-top: 20px;
}

.comment-item {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.comment-content {
  margin: 10px 0;
  padding: 15px;
  background-color: #f0f0f0;
  border-radius: 4px;
}

.comment-section {
  margin: 10px 0;
  padding: 15px 10px;
  box-sizing: border-box;
  background-color: #f0f0f0;
  border-radius: 4px;
  width: 100%;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  color: var(--dark-gray);
}

.close-button {
  background-color: var(--error-color);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.close-button:hover {
  background-color: #d32f2f;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .post-detail-modal {
    width: 95%;
    padding: 10px;
  }

  .user-item,
  .post-item,
  .category-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-actions,
  .post-actions,
  .category-actions {
    margin-top: 10px;
    width: 100%;
    justify-content: flex-end;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-number {
    font-size: 2em;
  }
}
